import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

// returns the suites in the data base

public class SqlTest2{
	
	  public static void main(String args[]) throws SQLException {
	
		  Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/bedandbreakfast",
					  "root", "");	
		  Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, 
		                                       ResultSet.CONCUR_UPDATABLE);
		  ResultSet uprs = stmt.executeQuery("SELECT name, number, beds, cost FROM suite");

		  System.out.println("Rooms Contained in the DATABASE:");
		  System.out.println("");
		  
		  while (uprs.next()) {
		        String name = uprs.getString("name");
		        int number = uprs.getInt("number");
		        int beds = uprs.getInt("beds");
		        int cost = uprs.getInt("cost");
		        System.out.println("Room Name: " +name + " -- Room Number: " + number + " -- Beds: " + beds + " -- Cost: $" + cost);
		        
		}



}
}